package com.tian.core.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.struts2.json.annotations.JSON;

/**
 * Operbutton entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "operbutton", catalog = "portalservermond")
public class Operbutton implements java.io.Serializable {

	// Fields

	private Integer id;
	private Ztree ztree;
	private String name;
	private String code;
	private String isOk;
	private Integer orderNum;

	// Constructors

	/** default constructor */
	public Operbutton() {
	}

	/** minimal constructor */
	public Operbutton(Ztree ztree) {
		this.ztree = ztree;
	}

	/** full constructor */
	public Operbutton(Ztree ztree, String name, String code, String isOk,
			Integer orderNum) {
		this.ztree = ztree;
		this.name = name;
		this.code = code;
		this.isOk = isOk;
		this.orderNum = orderNum;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@JSON(serialize=false)
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ztreeid", nullable = false)
	public Ztree getZtree() {
		return this.ztree;
	}

	public void setZtree(Ztree ztree) {
		this.ztree = ztree;
	}

	@Column(name = "name", length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "code", length = 1000)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "isOk", length = 1)
	public String getIsOk() {
		return this.isOk;
	}

	public void setIsOk(String isOk) {
		this.isOk = isOk;
	}

	@Column(name = "orderNum")
	public Integer getOrderNum() {
		return this.orderNum;
	}

	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}

}